<?php
class ResultFactory extends AbstractFactory {

    /**
     * Building Result object
     * @return object result
     */
    public static function newResultUsuarioNaoLogado() {
        $result = new GenericResult();
        $result->setSuccess(IResult::USUARIO_NAO_LOGADO);
        $result->setErrorTitle('Usu&aaculte;rio n&atildeo logado.');
        $result->setErrorMsg('Usu&aaculte;rio n&atildeo logado. Efetuar login novamente.');
        $result->setShowHeaderError(true);
        return $result;
    }
    
    /**
     * Building Result object
     * @return object result
     */
    public static function newResultFalha($title, $msg) {
        $result = new GenericResult();
        $result->setSuccess(IResult::FALHA);
        $result->setErrorTitle($title);
        $result->setErrorMsg($msg);
        //$result->setShowHeaderError(true);
        return $result;
    }
    
    /**
     * Building Result validation failed
     * @param array
     * @return object result
     */
    public static function newResultFalhaValidacao($arrayResult) {
        $result = new GenericResult();
        $result->setSuccess(IResult::FALHA);
        $result->setArrayResult($arrayResult);
        return $result;
    }
}

?>
